<cfcomponent>
<cffunction name="encryptstring" access="public" returntype="string">
  <cfargument name="textstring" type="string" required="yes">
  <cfargument name="key" type="string" required="no" default="#request.seedstring#">
  <cfset encstring = 'Invalid String Length'>
  <cfif trim(len(textstring)) GT 0>
  	<cfset encstring = trim(textstring)>
    <cfset encstring = #encrypt(encstring, key)#>
    <cfset encstring = tobase64(encstring)>
  </cfif>
  <cfreturn encstring>
</cffunction>
<cffunction name="decryptstring" access="public" returntype="string">
  <cfargument name="encstring" type="string" required="yes" default="" hint="encrypted string">
  <cfargument name="key" type="string" required="no" default="#request.seedstring#">
  <cfset dstring = 'Invalid String Length'>
  <cfif trim(len(encstring)) GT 0>
	<cfset dstring = trim(encstring)>
	<cfset dstring = ToBinary(dstring)>
    <cfset dstring = ToString(dstring)>    
	<cfset dstring = decrypt(dstring, key)>
  </cfif>
  <cfreturn dstring>
</cffunction>
<cffunction name="showcheckall" access="public" returntype="string" hint="shows the checkall/checknone check box">
  <cfargument name="formname" type="string" required="no" default="deleteform">
  <cfargument name="fieldname" type="string" required="no" default="deleteid">
	<cfoutput>
	<cfsavecontent variable="checkallbox">
	<style>
    .chkall {
    display: none;
    }
    .chkall +label {
    display: block;
    width: 32px;
    height: 32px;
    background: url(images/checkbox_unchecked.png);
    }
    .chkall:checked + label {
    background: url(images/checkbox_checked.png);
    }		
    </style>
    <input type="checkbox" name="chkall" id="chkall" class="chkall" onclick="if (this.checked){checkAll(document.#formname#.#fieldname#)} else if(!this.checked){uncheckAll(document.#formname#.#fieldname#)};" />
    <label for="chkall" title="Select All"></label>
	</cfsavecontent>
    </cfoutput>
  <cfreturn checkallbox>
</cffunction>

</cfcomponent>
